From 8d822e245b7b028f2c5168515ea1eba3ed1de449 Mon Sep 17 00:00:00 2001 From: oliskoli Date: Sat, 22 Apr 2006 18:36:57 +0000 Subject: [PATCH] Check for zero values before rounding. --- holux.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/holux.c b/holux.c index f3f44876a..c63a02bd1 100644 --- a/holux.c +++ b/holux.c @@ -188,9 +188,8 @@ static void holux_disp(const waypoint *wpt) /* round it to increase the accuracy */ - lon += (double)((int)lon/abs((int)lon)) * .5; - lat += (double)((int)lat/abs((int)lat)) * .5; - + if (lon != 0) lon += (double)((int)lon/abs((int)lon)) * .5; + if (lat != 0) lat += (double)((int)lat/abs((int)lat)) * .5; sIndex = le_read16(&((WPTHDR *)HxWFile)->num); ((WPTHDR *)HxWFile)->idx[sIndex] = sIndex; /* set the waypoint index */ -- 2.30.2